package com.ble.base;

import android.content.Intent;
import android.os.Bundle;
import android.widget.ImageView;
import android.widget.TextView;

import androidx.appcompat.app.AppCompatActivity;


/**
 * Created by xujie on 2016/3/7.
 */
public abstract class BaseActivity extends AppCompatActivity {


    protected TextView tv_title, tv_right;
    protected ImageView img_menu;

    protected abstract int getContentResid();

    protected AppCompatActivity self;

    @Override
    protected void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        setContentView(getContentResid());
        getSupportActionBar().hide();
//        Window w = getWindow();
//        w.setFlags(WindowManager.LayoutParams.FLAG_TRANSLUCENT_STATUS,  //设置StatusBar透明
//                WindowManager.LayoutParams.FLAG_TRANSLUCENT_STATUS);

        self = this;
        proess(savedInstanceState);
        init();
        loadDatas();
    }

    protected void proess(Bundle savedInstanceState) {
    }


    /**
     * 初始化
     */
    protected void init() {

    }

    /**
     * 数据加载
     */
    protected void loadDatas() {

    }

    /**
     * 带过场动画的启动activity方式
     *
     * @param intent
     * @param enterAnim
     * @param exitAnim
     */
    public void startActivity(Intent intent, int enterAnim, int exitAnim) {
        super.startActivity(intent);
        overridePendingTransition(enterAnim, exitAnim);
    }
}
